<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>商品页面</title>
    <!-- Fonts -->
    {{--<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel='stylesheet' type='text/css'>--}}
    <link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700" rel='stylesheet' type='text/css'>
    <!-- Styles -->
    <link href="/css/app.css" rel="stylesheet">
    {{--<link href="{{ elixir('css/app.css') }}" rel="stylesheet"> --}}
    <script src="/js/jquery-3.2.0.min.js"></script>
    <style>
        body {
            font-family: 'Lato';
        }
        .fa-btn {
            margin-right: 6px;
        }
        .flashy {
            font-family: "Source Sans Pro", Arial, sans-serif;
            padding: 11px 30px;
            border-radius: 4px;
            font-weight: 100;
            position: fixed;
            bottom: 20px;
            right: 20px;
            font-size: 12px;
            color: #fff;
        }
        .container{padding: 0;}
       /* .list-inline li:nth-child(1){ width: 50px;}
        .list-inline li:nth-child(2){ width: 80px;}*/
        .list-inline li{width: 53px;  height: 50px; line-height: 50px; font-size: 5px;}
        .dl-horizontal dt  { width: 53px;  height: 50px; line-height: 50px; font-size: 5px;}
        .dl-horizontal dd{ width: 150px; text-align: center; height: 50px; line-height: 50px; font-size: 5px;}
        dt,dd{float: left;}
        .tianjia {width: 100%;  height: 230px;cursor:pointer; background-color: #ffffff ;}
        .files{
            position:absolute; left:202px; top:52px; heigth:26px;cursor:pointer;
            filter: Alpha(opacity=0);
            -moz-opacity:0;
            opacity:0;
        }
        .list-inline  li{ padding: 0;width: 40px; }
        .dl-horizontal dt { width: 40px;}

    </style>
</head>
<body id="app-layout">
<div class="" style="min-height:600px; background-color: #a7a7a7; border: none;">
<nav class="navbar navbar-default" role="navigation" style="margin-bottom: 0;">
    <div class="navbar-header" style="float: left;">
       <a class="navbar-brand" href="#">《</a>
    </div>
    <div class=" navbar-collapse" id="bs-example-navbar-collapse-1" style="float: left;">
        <ul class="nav navbar-nav" style= "width: 300px;">
            <li class="" style="width: 100%; text-align: center;">
                <a href="#">商品展示</a>
            </li>
        </ul>
    </div>
</nav>
    <form class="form-horizontal" role="form"  method="post" action="">
{{--<div class="container" style="width: 100%;  height: auto ;  margin-top: 20px; background-color: #ffffff;" >--}}
    @foreach($get_goods_info as $key => $goodsinfo)
       {{-- {{$goodsinfo->id}}--}}
        <div class="container" style="width: 100%;  height: auto ;  margin-top: 20px; background-color: #ffffff;" >
            <div class="single" style="width: 5%; height:150px; float: left; display: none;">
                <div class="col-sm-6 col-md-3" style=" line-height: 150px;">
                    {{--<input  class="singles" type="checkbox" name="single">--}}
                    <input type="checkbox" class="ckb"  name="single" value="{{$goodsinfo->id}}">
                </div>
            </div>
            <div class="" style="width: 33%; height:150px; float: left;">
                <div class="col-sm-6 col-md-3" style=" line-height: 150px;">
                    <img src="/img/goods1.jpg" alt="商品缩略图" width="100" height="100">
                </div>
            </div>
            <div style="width: 50%; height:150px; float: left; ">
                <ul class="list-inline" style="margin: 0;padding: 0;">
                    <li>名称</li>
                    <li>{{$goodsinfo->title}}</li>
                    <li>价格</li>
                    <li>￥119.00</li>
                </ul>
                <ul class="list-inline" style="margin: 0; padding: 0;">
                    <li>颜色</li>
                    <li>黑色</li>
                    <li>尺码</li>
                    <li>3</li>
                </ul>
                <ul class="list-inline" style="margin: 0; padding: 0; ">
                    <li>描述</li>
                    <li style="width: 130px;">商品的详细信息描述</li>

                </ul>
               {{-- <dl class="dl-horizontal" style="width: 100%;margin: 0; padding: 0;">
                    <dt>描述</dt>
                    <dd>商品的详细信息描述</dd>
                </dl>--}}
            </div>
            <div style="width: 5%; float: left; line-height: 150px;">
               {{-- <input type="button" name="updategd_btn" class="btn btn-default" style="border-radius:10px 10px 10px 10px;background-color: #a7a7a7; width: 50px;" onclick="upgoodsinfo()" value="修改" >--}}
            <a href="{{ url('/goods/update') }}?id={{$goodsinfo->id}}" class="btn btn-default" style="width:50px; ">修改</a>
            </div>
        </div>
        <input type="hidden" name="gd_id" value="{{$goodsinfo->id}}">
    @endforeach
    </form>
        <div  class="single" style="background-color: #ffffff; height: 40px; position: absolute; bottom: 0; width: 100%; display: none ; ">
        <div class="checkbox" style="float: left;">
            <label>
                <input type="checkbox" id="ckb_selectAll" title="选中/取消选中">
              {{--  <a href="javascript:void(0);" onclick="del_()" title="删除选定数据" style="font-weight:normal">删除</a>--}}
{{--
                <input type="checkbox" id="checkAll"> 全选
--}}
            </label>
        </div>
        <div style="float: left; margin-left: 5px;">
            <input type="button" name="delgd_btn" class="btn btn-default" style="border-radius:10px 10px 10px 10px;background-color: #a7a7a7; width: 100px;" onclick="delgoodsinfo()" value="删除" >
            <input type="button" class="btn btn-default" style="border-radius:10px 10px 10px 10px;background-color: #a7a7a7; width: 100px;" value="发布" >
        </div>
        </div>
</div>
</body>
<meta name="csrf_token" id="token" content="{{ csrf_token() }}">
<!-- JavaScripts -->
<script src="/js/app.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/default.js"></script>
<script>
    $(document).ready(function(){
        $(".container").click(function(){
            $(".dis_button").css("display","block");
            $(".single").css("display","block");
        });
        $("#ckb_selectAll").click(function(){
            $(".ckb").prop("checked",$(this).prop("checked"));
        });
    });
    function delgoodsinfo(){
        var ids = '';
        $(".ckb").each(function() {
            if ($(this).is(':checked')) {
                ids += ',' + $(this).val();
            }
        });
        ids = ids.substring(1);
        if (ids.length == 0) {
            alert('请选择要删除的选项');
        } else {
            if (confirm("确定删除?")) {
                $.ajax({
                    type: "POST",
                    dataType: 'json',
                    url:  "/goods/del",
                    data: {ids:ids} ,
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
                        },
                    success: function(data) {
                        location.reload();
                    },
                    error: function(XMLHttpRequest, textStatus) {
                        console.log(XMLHttpRequest.status);
                        console.log(XMLHttpRequest.readyState);
                        console.log(textStatus);
                        alert(textStatus);
                    }
                });
            }
        }
    }
    function  upgoodsinfo(){
        /*$('input[name="single"]:checked').each(function(){
           alert($(this).val());
        });*/
     /*   $('input[name="single"]:checked').each(function(){
            alert($(this).val());
        })*/
       // alert($('input[name="single"]').val());
    }
</script>
</body>
</html>
